package org.aepscolombia.platform.models.entity;
// Generated Jan 13, 2014 2:36:33 PM by Hibernate Tools 3.2.1.GA


import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * PreparationsTypes generated by hbm2java
 */
@Entity
@Table(name="preparations_types"
    ,catalog="madr_bd10"
)
public class PreparationsTypes  implements java.io.Serializable {


     private Integer idPreTyp;
     private String namePreTyp;
     private boolean statusPreTyp;
     private Set preparationses = new HashSet(0);
     private Set cropsTypeses = new HashSet(0);

    public PreparationsTypes() {
    }

	
    public PreparationsTypes(String namePreTyp, boolean statusPreTyp) {
        this.namePreTyp = namePreTyp;
        this.statusPreTyp = statusPreTyp;
    }
    public PreparationsTypes(String namePreTyp, boolean statusPreTyp, Set preparationses, Set cropsTypeses) {
       this.namePreTyp = namePreTyp;
       this.statusPreTyp = statusPreTyp;
       this.preparationses = preparationses;
       this.cropsTypeses = cropsTypeses;
    }
   
     @Id @GeneratedValue(strategy=IDENTITY)
    
    @Column(name="id_pre_typ", unique=true, nullable=false)
    public Integer getIdPreTyp() {
        return this.idPreTyp;
    }
    
    public void setIdPreTyp(Integer idPreTyp) {
        this.idPreTyp = idPreTyp;
    }
    
    @Column(name="name_pre_typ", nullable=false, length=45)
    public String getNamePreTyp() {
        return this.namePreTyp;
    }
    
    public void setNamePreTyp(String namePreTyp) {
        this.namePreTyp = namePreTyp;
    }
    
    @Column(name="status_pre_typ", nullable=false)
    public boolean isStatusPreTyp() {
        return this.statusPreTyp;
    }
    
    public void setStatusPreTyp(boolean statusPreTyp) {
        this.statusPreTyp = statusPreTyp;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="preparationsTypes")
    public Set getPreparationses() {
        return this.preparationses;
    }
    
    public void setPreparationses(Set preparationses) {
        this.preparationses = preparationses;
    }
@ManyToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY)
    @JoinTable(name="preparations_types_crops_types", catalog="madr_bd10", joinColumns = { 
        @JoinColumn(name="id_preparation_type_pre_typ_cro", nullable=false, updatable=false) }, inverseJoinColumns = { 
        @JoinColumn(name="id_crop_type_pre_typ_cro", nullable=false, updatable=false) })
    public Set getCropsTypeses() {
        return this.cropsTypeses;
    }
    
    public void setCropsTypeses(Set cropsTypeses) {
        this.cropsTypeses = cropsTypeses;
    }




}


